﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace RandomNumber
{
    public partial class Main : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void generate_Click(object sender, EventArgs e)
        {
            Random rand = new Random();
            int fNum = Convert.ToInt32(this.firstNum.Value);
            int sNum = Convert.ToInt32(this.secondNum.Value);

            this.randNum.Value = rand.Next(fNum, sNum + 1).ToString();
        }

        protected void webGenerate_Click(object sender, EventArgs e)
        {
            Random rand = new Random();
            int fNum = Convert.ToInt32(this.webFirstNum.Text);
            int sNum = Convert.ToInt32(this.webSecondNum.Text);

            this.webRandNum.Text = rand.Next(fNum, sNum + 1).ToString();
        }
    }
}